#ifndef __LOG__
#define __LOG__

#include <sys/syslog.h>
#include <syslog.h>
#include <time.h>
#include <unistd.h>

#define LOG_LOGIN(username)                                                    \
  do {                                                                         \
    time_t now = time(NULL);                                                   \
    syslog(LOG_INFO, "user: %s, login time: %s", username, ctime(&now));       \
  } while (0)

#define LOG_FUNC(username, operation, msg)                                     \
  do {                                                                         \
    time_t now = time(NULL);                                                   \
    syslog(LOG_INFO, "user: %s, operation: %s, %s", username, operation, msg); \
  } while (0)

#endif
